///////////////////////////////////////////////////////////////////////
// WriteEngine2.h
//
// Wrapper for IWriteEngine2 Interface
//
// Written by Nic Wilson
//
#pragma once

class CDiscRecorder;

class CWriteEngine2
{
private:
	IWriteEngine2*	m_WriteEngine2;
	SAFEARRAY*		m_mediaTypesArray;
	HRESULT			m_hResult;
	CString			m_errorMessage;
	HWND			m_hNotificationWnd;
	bool			m_closeMedia;


public:
	CWriteEngine2(void);
	~CWriteEngine2(void);

	inline	HRESULT GetHresult() {return m_hResult;}
	inline	CString GetErrorMessage() {return m_errorMessage;}

	inline	IWriteEngine2* GetInterface() {return m_WriteEngine2;}
	bool	Initialize(CDiscRecorder* pDiscRecorder, const CString& clientName);

	bool	Burn(HWND hWnd, IStream* data, LONG startingBlockAddress, LONG numberOfBlocks);

	ULONG	GetTotalSupportedMediaTypes();
	int		GetSupportedMediaType(ULONG index);

	inline	void SetCloseMedia(bool closeMedia){m_closeMedia = closeMedia;}

	IWriteEngine2* GetIWriteEngine2Ptr();
protected:
	IStream*	m_streamData;
};
